package me.lc.linklinkchrist.core;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;

import me.lc.linklinkchrist.entity.StageInfo;
import me.lc.linklinkchrist.util.GsonHelper;
import me.lc.linklinkchrist.util.ShareSettingUtil;

import com.google.gson.reflect.TypeToken;

public class StageManager {
	public static StageManager instance = new StageManager();

	public List<StageInfo> stageInfos;
	public HashMap<String, Integer> stageScores;

	// 消除总数计数
	public int totalCouples;

	// 金币
	public int goldCount;

	// 是否开启声音 1开启 0关闭
	public int isAudioOn;

	private static final String TOTAL_COUPLES_KEY = "totalCouples";

	// 新的
	private static final String STAGE_SCORE_KEY = "stageScores";

	private static final String GOLD_KEY = "goldCount";
	private static final String IS_AUDIO_ON = "isAudioOn";

	public int currentStage = -1;

	// 挑战相关
	public boolean isChallenge = false;
	public String challengeToUser = "";
	public int challengeScore = 0;

	private StageManager() {
		stageInfos = new ArrayList<StageInfo>();
	}

	public void saveTotalCouples() {
		ShareSettingUtil.storeIntSetting(TOTAL_COUPLES_KEY, totalCouples);
	}

	public void saveGold() {
		ShareSettingUtil.storeIntSetting(GOLD_KEY, goldCount);
	}

	public void saveIsAudioOn() {
		ShareSettingUtil.storeIntSetting(IS_AUDIO_ON, isAudioOn);
	}

	public void saveStageScores() {
		ShareSettingUtil.storeStringSetting(STAGE_SCORE_KEY,
				GsonHelper.getJsonString(stageScores));
	}

	public boolean isHaveOldStageInfos() {
		return !ShareSettingUtil.getStringSetting(STAGE_INFO_KEY)
				.equalsIgnoreCase("null");
	}

	/**
	 * 初始化游戏信息
	 */
	@SuppressWarnings("unchecked")
	public void initStageInfo() {
		// long method here
		genStageInfo();

		stageScores = new HashMap<String, Integer>();
		String value = ShareSettingUtil.getStringSetting(STAGE_SCORE_KEY);
		if (!value.equalsIgnoreCase("null")) {
			stageScores = (HashMap<String, Integer>) GsonHelper
					.getObjectbyJsonString(value,
							new TypeToken<HashMap<String, Integer>>() {
							}.getType());

			for (StageInfo stageInfo : stageInfos) {
				String key = stageInfo.getStageName();
				if (stageScores.containsKey(key)) {
					stageInfo.setScore(stageScores.get(key));
					stageInfo.setLock(false);
				}
			}
		}
	}

	public void initGameParams() {
		totalCouples = ShareSettingUtil.getIntSetting(TOTAL_COUPLES_KEY, 0);
		goldCount = ShareSettingUtil.getIntSetting(GOLD_KEY, 500);
		isAudioOn = ShareSettingUtil.getIntSetting(IS_AUDIO_ON, 1);
	}

	/**
	 * 用代码方式创建所有的关卡对象，挫了点，但是好维护
	 */
	private void genStageInfo() {
		// 1
		StageInfo stage1 = new StageInfo();
		stage1.setStageName("1");
		stage1.setArrType(GameArrangeType.Normal);
		stage1.setTotalTime(60);
		stage1.setLock(false);
		stage1.setItemCount(8);
		stage1.setItemStartIndex(0);
		stageInfos.add(stage1);

		// 2
		StageInfo stage2 = new StageInfo();
		stage2.setStageName("2");
		stage2.setArrType(GameArrangeType.Left);
		stage2.setTotalTime(60);
		stage2.setLock(true);
		stage2.setItemCount(8);
		stage2.setItemStartIndex(0);
		stageInfos.add(stage2);

		// 3
		StageInfo stage3 = new StageInfo();
		stage3.setStageName("3");
		stage3.setArrType(GameArrangeType.Right);
		stage3.setTotalTime(60);
		stage3.setLock(true);
		stage3.setItemCount(8);
		stage3.setItemStartIndex(0);
		stageInfos.add(stage3);

		// 4
		StageInfo stage4 = new StageInfo();
		stage4.setStageName("4");
		stage4.setArrType(GameArrangeType.Top);
		stage4.setTotalTime(60);
		stage4.setLock(true);
		stage4.setItemCount(8);
		stage4.setItemStartIndex(0);
		stageInfos.add(stage4);

		// 5
		StageInfo stage5 = new StageInfo();
		stage5.setStageName("5");
		stage5.setArrType(GameArrangeType.Bottom);
		stage5.setTotalTime(60);
		stage5.setLock(true);
		stage5.setItemCount(8);
		stage5.setItemStartIndex(0);
		stageInfos.add(stage5);

		// 6
		StageInfo stage6 = new StageInfo();
		stage6.setStageName("6");
		stage6.setArrType(GameArrangeType.LeftRight);
		stage6.setTotalTime(60);
		stage6.setLock(true);
		stage6.setItemCount(8);
		stage6.setItemStartIndex(0);
		stageInfos.add(stage6);

		// 7
		StageInfo stage7 = new StageInfo();
		stage7.setStageName("7");
		stage7.setArrType(GameArrangeType.TopBottom);
		stage7.setTotalTime(60);
		stage7.setLock(true);
		stage7.setItemCount(8);
		stage7.setItemStartIndex(0);
		stageInfos.add(stage7);

		// 8
		StageInfo stage8 = new StageInfo();
		stage8.setStageName("8");
		stage8.setArrType(GameArrangeType.Normal);
		stage8.setTotalTime(60);
		stage8.setLock(true);
		stage8.setItemCount(10);
		stage8.setItemStartIndex(8);
		stageInfos.add(stage8);

		// 9
		StageInfo stage9 = new StageInfo();
		stage9.setStageName("9");
		stage9.setArrType(GameArrangeType.Right);
		stage9.setTotalTime(60);
		stage9.setLock(true);
		stage9.setItemCount(10);
		stage9.setItemStartIndex(8);
		stageInfos.add(stage9);

		// 10
		StageInfo stage10 = new StageInfo();
		stage10.setStageName("10");
		stage10.setArrType(GameArrangeType.Top);
		stage10.setTotalTime(60);
		stage10.setLock(true);
		stage10.setItemCount(10);
		stage10.setItemStartIndex(8);
		stageInfos.add(stage10);

		// 11
		StageInfo stage11 = new StageInfo();
		stage11.setStageName("11");
		stage11.setArrType(GameArrangeType.Left);
		stage11.setTotalTime(60);
		stage11.setLock(true);
		stage11.setItemCount(10);
		stage11.setItemStartIndex(8);
		stageInfos.add(stage11);

		// 12
		StageInfo stage12 = new StageInfo();
		stage12.setStageName("12");
		stage12.setArrType(GameArrangeType.Bottom);
		stage12.setTotalTime(60);
		stage12.setLock(true);
		stage12.setItemCount(10);
		stage12.setItemStartIndex(8);
		stageInfos.add(stage12);

		// 13
		StageInfo stage13 = new StageInfo();
		stage13.setStageName("13");
		stage13.setArrType(GameArrangeType.TopBottom);
		stage13.setTotalTime(60);
		stage13.setLock(true);
		stage13.setItemCount(10);
		stage13.setItemStartIndex(8);
		stageInfos.add(stage13);

		// 14
		StageInfo stage14 = new StageInfo();
		stage14.setStageName("14");
		stage14.setArrType(GameArrangeType.LeftRight);
		stage14.setTotalTime(60);
		stage14.setLock(true);
		stage14.setItemCount(10);
		stage14.setItemStartIndex(8);
		stageInfos.add(stage14);

		// 15
		StageInfo stage15 = new StageInfo();
		stage15.setStageName("15");
		stage15.setArrType(GameArrangeType.Normal);
		stage15.setTotalTime(60);
		stage15.setLock(true);
		stage15.setItemCount(10);
		stage15.setItemStartIndex(10);
		stageInfos.add(stage15);

		// 16
		StageInfo stage16 = new StageInfo();
		stage16.setStageName("16");
		stage16.setArrType(GameArrangeType.TopBottom);
		stage16.setTotalTime(60);
		stage16.setLock(true);
		stage16.setItemCount(10);
		stage16.setItemStartIndex(10);
		stageInfos.add(stage16);

		// 17
		StageInfo stage17 = new StageInfo();
		stage17.setStageName("17");
		stage17.setArrType(GameArrangeType.LeftRight);
		stage17.setTotalTime(60);
		stage17.setLock(true);
		stage17.setItemCount(10);
		stage17.setItemStartIndex(10);
		stageInfos.add(stage17);

		// 18
		StageInfo stage18 = new StageInfo();
		stage18.setStageName("18");
		stage18.setArrType(GameArrangeType.Top);
		stage18.setTotalTime(60);
		stage18.setLock(true);
		stage18.setItemCount(10);
		stage18.setItemStartIndex(10);
		stageInfos.add(stage18);

		// 19
		StageInfo stage19 = new StageInfo();
		stage19.setStageName("19");
		stage19.setArrType(GameArrangeType.Bottom);
		stage19.setTotalTime(60);
		stage19.setLock(true);
		stage19.setItemCount(10);
		stage19.setItemStartIndex(10);
		stageInfos.add(stage19);

		// 20
		StageInfo stage20 = new StageInfo();
		stage20.setStageName("20");
		stage20.setArrType(GameArrangeType.Left);
		stage20.setTotalTime(60);
		stage20.setLock(true);
		stage20.setItemCount(10);
		stage20.setItemStartIndex(10);
		stageInfos.add(stage20);

		// 21
		StageInfo stage21 = new StageInfo();
		stage21.setStageName("21");
		stage21.setArrType(GameArrangeType.Right);
		stage21.setTotalTime(60);
		stage21.setLock(true);
		stage21.setItemCount(10);
		stage21.setItemStartIndex(10);
		stageInfos.add(stage21);

		// 22
		StageInfo stage22 = new StageInfo();
		stage22.setStageName("22");
		stage22.setArrType(GameArrangeType.Left);
		stage22.setTotalTime(60);
		stage22.setLock(true);
		stage22.setItemCount(11);
		stage22.setItemStartIndex(13);
		stageInfos.add(stage22);

		// 23
		StageInfo stage23 = new StageInfo();
		stage23.setStageName("23");
		stage23.setArrType(GameArrangeType.Right);
		stage23.setTotalTime(60);
		stage23.setLock(true);
		stage23.setItemCount(11);
		stage23.setItemStartIndex(13);
		stageInfos.add(stage23);

		// 24
		StageInfo stage24 = new StageInfo();
		stage24.setStageName("24");
		stage24.setArrType(GameArrangeType.Normal);
		stage24.setTotalTime(60);
		stage24.setLock(true);
		stage24.setItemCount(11);
		stage24.setItemStartIndex(12);
		stageInfos.add(stage24);

		// 25
		StageInfo stage25 = new StageInfo();
		stage25.setStageName("25");
		stage25.setArrType(GameArrangeType.Bottom);
		stage25.setTotalTime(60);
		stage25.setLock(true);
		stage25.setItemCount(11);
		stage25.setItemStartIndex(12);
		stageInfos.add(stage25);

		// 26
		StageInfo stage26 = new StageInfo();
		stage26.setStageName("26");
		stage26.setArrType(GameArrangeType.Top);
		stage26.setTotalTime(60);
		stage26.setLock(true);
		stage26.setItemCount(11);
		stage26.setItemStartIndex(11);
		stageInfos.add(stage26);

		// 27
		StageInfo stage27 = new StageInfo();
		stage27.setStageName("27");
		stage27.setArrType(GameArrangeType.TopBottom);
		stage27.setTotalTime(60);
		stage27.setLock(true);
		stage27.setItemCount(11);
		stage27.setItemStartIndex(11);
		stageInfos.add(stage27);

		// 28
		StageInfo stage28 = new StageInfo();
		stage28.setStageName("28");
		stage28.setArrType(GameArrangeType.LeftRight);
		stage28.setTotalTime(60);
		stage28.setLock(true);
		stage28.setItemCount(11);
		stage28.setItemStartIndex(11);
		stageInfos.add(stage28);

		// 29
		StageInfo stage29 = new StageInfo();
		stage29.setStageName("29");
		stage29.setArrType(GameArrangeType.Normal);
		stage29.setTotalTime(60);
		stage29.setLock(true);
		stage29.setItemCount(13);
		stage29.setItemStartIndex(14);
		stageInfos.add(stage29);

		// 30
		StageInfo stage30 = new StageInfo();
		stage30.setStageName("30");
		stage30.setArrType(GameArrangeType.Left);
		stage30.setTotalTime(60);
		stage30.setLock(true);
		stage30.setItemCount(13);
		stage30.setItemStartIndex(14);
		stageInfos.add(stage30);

		// 31
		StageInfo stage31 = new StageInfo();
		stage31.setStageName("31");
		stage31.setArrType(GameArrangeType.Top);
		stage31.setTotalTime(60);
		stage31.setLock(true);
		stage31.setItemCount(13);
		stage31.setItemStartIndex(14);
		stageInfos.add(stage31);

		// 32
		StageInfo stage32 = new StageInfo();
		stage32.setStageName("32");
		stage32.setArrType(GameArrangeType.Bottom);
		stage32.setTotalTime(60);
		stage32.setLock(true);
		stage32.setItemCount(13);
		stage32.setItemStartIndex(14);
		stageInfos.add(stage32);

		// 33
		StageInfo stage33 = new StageInfo();
		stage33.setStageName("33");
		stage33.setArrType(GameArrangeType.TopBottom);
		stage33.setTotalTime(60);
		stage33.setLock(true);
		stage33.setItemCount(13);
		stage33.setItemStartIndex(14);
		stageInfos.add(stage33);

		// 34
		StageInfo stage34 = new StageInfo();
		stage34.setStageName("34");
		stage34.setArrType(GameArrangeType.LeftRight);
		stage34.setTotalTime(60);
		stage34.setLock(true);
		stage34.setItemCount(13);
		stage34.setItemStartIndex(16);
		stageInfos.add(stage34);

		// 35
		StageInfo stage35 = new StageInfo();
		stage35.setStageName("35");
		stage35.setArrType(GameArrangeType.Normal);
		stage35.setTotalTime(60);
		stage35.setLock(true);
		stage35.setItemCount(9);
		stage35.setItemStartIndex(20);
		stageInfos.add(stage35);

		// 36
		StageInfo stage36 = new StageInfo();
		stage36.setStageName("36");
		stage36.setArrType(GameArrangeType.LeftRight);
		stage36.setTotalTime(60);
		stage36.setLock(true);
		stage36.setItemCount(13);
		stage36.setItemStartIndex(16);
		stageInfos.add(stage36);

		// 37
		StageInfo stage37 = new StageInfo();
		stage37.setStageName("37");
		stage37.setArrType(GameArrangeType.Left);
		stage37.setTotalTime(60);
		stage37.setLock(true);
		stage37.setItemCount(13);
		stage37.setItemStartIndex(16);
		stageInfos.add(stage37);

		// 38
		StageInfo stage38 = new StageInfo();
		stage38.setStageName("38");
		stage38.setArrType(GameArrangeType.TopBottom);
		stage38.setTotalTime(60);
		stage38.setLock(true);
		stage38.setItemCount(13);
		stage38.setItemStartIndex(16);
		stageInfos.add(stage38);

		// 39
		StageInfo stage39 = new StageInfo();
		stage39.setStageName("39");
		stage39.setArrType(GameArrangeType.Top);
		stage39.setTotalTime(60);
		stage39.setLock(true);
		stage39.setItemCount(13);
		stage39.setItemStartIndex(16);
		stageInfos.add(stage39);

		// 40
		StageInfo stage40 = new StageInfo();
		stage40.setStageName("40");
		stage40.setArrType(GameArrangeType.Top);
		stage40.setTotalTime(60);
		stage40.setLock(true);
		stage40.setItemCount(7);
		stage40.setItemStartIndex(30);
		stageInfos.add(stage40);

		// 41
		StageInfo stage41 = new StageInfo();
		stage41.setStageName("41");
		stage41.setArrType(GameArrangeType.Normal);
		stage41.setTotalTime(60);
		stage41.setLock(true);
		stage41.setItemCount(7);
		stage41.setItemStartIndex(30);
		stageInfos.add(stage41);

		// 42
		StageInfo stage42 = new StageInfo();
		stage42.setStageName("42");
		stage42.setArrType(GameArrangeType.Left);
		stage42.setTotalTime(60);
		stage42.setLock(true);
		stage42.setItemCount(7);
		stage42.setItemStartIndex(30);
		stageInfos.add(stage42);

		// 43
		StageInfo stage43 = new StageInfo();
		stage43.setStageName("43");
		stage43.setArrType(GameArrangeType.Right);
		stage43.setTotalTime(60);
		stage43.setLock(true);
		stage43.setItemCount(7);
		stage43.setItemStartIndex(30);
		stageInfos.add(stage43);

		// 44
		StageInfo stage44 = new StageInfo();
		stage44.setStageName("44");
		stage44.setArrType(GameArrangeType.Bottom);
		stage44.setTotalTime(60);
		stage44.setLock(true);
		stage44.setItemCount(7);
		stage44.setItemStartIndex(30);
		stageInfos.add(stage44);

		// 45
		StageInfo stage45 = new StageInfo();
		stage45.setStageName("45");
		stage45.setArrType(GameArrangeType.TopBottom);
		stage45.setTotalTime(60);
		stage45.setLock(true);
		stage45.setItemCount(7);
		stage45.setItemStartIndex(30);
		stageInfos.add(stage45);

		// 46
		StageInfo stage46 = new StageInfo();
		stage46.setStageName("46");
		stage46.setArrType(GameArrangeType.Normal);
		stage46.setTotalTime(60);
		stage46.setLock(true);
		stage46.setItemCount(12);
		stage46.setItemStartIndex(20);
		stageInfos.add(stage46);

		// 47
		StageInfo stage47 = new StageInfo();
		stage47.setStageName("47");
		stage47.setArrType(GameArrangeType.Left);
		stage47.setTotalTime(60);
		stage47.setLock(true);
		stage47.setItemCount(12);
		stage47.setItemStartIndex(20);
		stageInfos.add(stage47);

		// 48
		StageInfo stage48 = new StageInfo();
		stage48.setStageName("48");
		stage48.setArrType(GameArrangeType.Right);
		stage48.setTotalTime(60);
		stage48.setLock(true);
		stage48.setItemCount(12);
		stage48.setItemStartIndex(20);
		stageInfos.add(stage48);

		// 49
		StageInfo stage49 = new StageInfo();
		stage49.setStageName("49");
		stage49.setArrType(GameArrangeType.TopBottom);
		stage49.setTotalTime(60);
		stage49.setLock(true);
		stage49.setItemCount(12);
		stage49.setItemStartIndex(20);
		stageInfos.add(stage49);

		// 50
		StageInfo stage50 = new StageInfo();
		stage50.setStageName("50");
		stage50.setArrType(GameArrangeType.LeftRight);
		stage50.setTotalTime(60);
		stage50.setLock(true);
		stage50.setItemCount(12);
		stage50.setItemStartIndex(20);
		stageInfos.add(stage50);

		// 51
		StageInfo stage51 = new StageInfo();
		stage51.setStageName("51");
		stage51.setArrType(GameArrangeType.Normal);
		stage51.setTotalTime(60);
		stage51.setLock(true);
		stage51.setItemCount(14);
		stage51.setItemStartIndex(0);
		stageInfos.add(stage51);

		// 52
		StageInfo stage52 = new StageInfo();
		stage52.setStageName("52");
		stage52.setArrType(GameArrangeType.Left);
		stage52.setTotalTime(60);
		stage52.setLock(true);
		stage52.setItemCount(14);
		stage52.setItemStartIndex(0);
		stageInfos.add(stage52);

		// 53
		StageInfo stage53 = new StageInfo();
		stage53.setStageName("53");
		stage53.setArrType(GameArrangeType.Right);
		stage53.setTotalTime(60);
		stage53.setLock(true);
		stage53.setItemCount(14);
		stage53.setItemStartIndex(0);
		stageInfos.add(stage53);

		// 54
		StageInfo stage54 = new StageInfo();
		stage54.setStageName("54");
		stage54.setArrType(GameArrangeType.LeftRight);
		stage54.setTotalTime(60);
		stage54.setLock(true);
		stage54.setItemCount(14);
		stage54.setItemStartIndex(0);
		stageInfos.add(stage54);

		// 55
		StageInfo stage55 = new StageInfo();
		stage55.setStageName("55");
		stage55.setArrType(GameArrangeType.TopBottom);
		stage55.setTotalTime(60);
		stage55.setLock(true);
		stage55.setItemCount(14);
		stage55.setItemStartIndex(0);
		stageInfos.add(stage55);

		// 56
		StageInfo stage56 = new StageInfo();
		stage56.setStageName("56");
		stage56.setArrType(GameArrangeType.Normal);
		stage56.setTotalTime(60);
		stage56.setLock(true);
		stage56.setItemCount(15);
		stage56.setItemStartIndex(8);
		stageInfos.add(stage56);

		// 57
		StageInfo stage57 = new StageInfo();
		stage57.setStageName("57");
		stage57.setArrType(GameArrangeType.TopBottom);
		stage57.setTotalTime(60);
		stage57.setLock(true);
		stage57.setItemCount(15);
		stage57.setItemStartIndex(8);
		stageInfos.add(stage57);

		// 58
		StageInfo stage58 = new StageInfo();
		stage58.setStageName("58");
		stage58.setArrType(GameArrangeType.LeftRight);
		stage58.setTotalTime(60);
		stage58.setLock(true);
		stage58.setItemCount(15);
		stage58.setItemStartIndex(8);
		stageInfos.add(stage58);

		// 59
		StageInfo stage59 = new StageInfo();
		stage59.setStageName("59");
		stage59.setArrType(GameArrangeType.Left);
		stage59.setTotalTime(60);
		stage59.setLock(true);
		stage59.setItemCount(15);
		stage59.setItemStartIndex(8);
		stageInfos.add(stage59);

		// 60
		StageInfo stage60 = new StageInfo();
		stage60.setStageName("60");
		stage60.setArrType(GameArrangeType.Right);
		stage60.setTotalTime(60);
		stage60.setLock(true);
		stage60.setItemCount(15);
		stage60.setItemStartIndex(8);
		stageInfos.add(stage60);

		// 61
		StageInfo stage61 = new StageInfo();
		stage61.setStageName("61");
		stage61.setArrType(GameArrangeType.Top);
		stage61.setTotalTime(60);
		stage61.setLock(true);
		stage61.setItemCount(15);
		stage61.setItemStartIndex(8);
		stageInfos.add(stage61);

		// 62
		StageInfo stage62 = new StageInfo();
		stage62.setStageName("62");
		stage62.setArrType(GameArrangeType.Bottom);
		stage62.setTotalTime(60);
		stage62.setLock(true);
		stage62.setItemCount(15);
		stage62.setItemStartIndex(8);
		stageInfos.add(stage62);

		// 63
		StageInfo stage63 = new StageInfo();
		stage63.setStageName("63");
		stage63.setArrType(GameArrangeType.Normal);
		stage63.setTotalTime(60);
		stage63.setLock(true);
		stage63.setItemCount(9);
		stage63.setItemStartIndex(19);
		stageInfos.add(stage63);

		// 64
		StageInfo stage64 = new StageInfo();
		stage64.setStageName("64");
		stage64.setArrType(GameArrangeType.LeftRight);
		stage64.setTotalTime(60);
		stage64.setLock(true);
		stage64.setItemCount(9);
		stage64.setItemStartIndex(19);
		stageInfos.add(stage64);

		// 65
		StageInfo stage65 = new StageInfo();
		stage65.setStageName("65");
		stage65.setArrType(GameArrangeType.LeftRight);
		stage65.setTotalTime(60);
		stage65.setLock(true);
		stage65.setItemCount(10);
		stage65.setItemStartIndex(19);
		stageInfos.add(stage65);

		// 66
		StageInfo stage66 = new StageInfo();
		stage66.setStageName("66");
		stage66.setArrType(GameArrangeType.Left);
		stage66.setTotalTime(60);
		stage66.setLock(true);
		stage66.setItemCount(12);
		stage66.setItemStartIndex(19);
		stageInfos.add(stage66);

		// 67
		StageInfo stage67 = new StageInfo();
		stage67.setStageName("67");
		stage67.setArrType(GameArrangeType.Right);
		stage67.setTotalTime(60);
		stage67.setLock(true);
		stage67.setItemCount(11);
		stage67.setItemStartIndex(19);
		stageInfos.add(stage67);

		// 68
		StageInfo stage68 = new StageInfo();
		stage68.setStageName("68");
		stage68.setArrType(GameArrangeType.Normal);
		stage68.setTotalTime(60);
		stage68.setLock(true);
		stage68.setItemCount(16);
		stage68.setItemStartIndex(19);
		stageInfos.add(stage68);

		// 69
		StageInfo stage69 = new StageInfo();
		stage69.setStageName("69");
		stage69.setArrType(GameArrangeType.TopBottom);
		stage69.setTotalTime(60);
		stage69.setLock(true);
		stage69.setItemCount(13);
		stage69.setItemStartIndex(7);
		stageInfos.add(stage69);

		// 70
		StageInfo stage70 = new StageInfo();
		stage70.setStageName("70");
		stage70.setArrType(GameArrangeType.LeftRight);
		stage70.setTotalTime(60);
		stage70.setLock(true);
		stage70.setItemCount(12);
		stage70.setItemStartIndex(6);
		stageInfos.add(stage70);

		// 71
		StageInfo stage71 = new StageInfo();
		stage71.setStageName("71");
		stage71.setArrType(GameArrangeType.Top);
		stage71.setTotalTime(60);
		stage71.setLock(true);
		stage71.setItemCount(14);
		stage71.setItemStartIndex(18);
		stageInfos.add(stage71);

		// 72
		StageInfo stage72 = new StageInfo();
		stage72.setStageName("72");
		stage72.setArrType(GameArrangeType.Left);
		stage72.setTotalTime(60);
		stage72.setLock(true);
		stage72.setItemCount(14);
		stage72.setItemStartIndex(9);
		stageInfos.add(stage72);

		// 73
		StageInfo stage73 = new StageInfo();
		stage73.setStageName("73");
		stage73.setArrType(GameArrangeType.Right);
		stage73.setTotalTime(60);
		stage73.setLock(true);
		stage73.setItemCount(14);
		stage73.setItemStartIndex(9);
		stageInfos.add(stage73);

		// 74
		StageInfo stage74 = new StageInfo();
		stage74.setStageName("74");
		stage74.setArrType(GameArrangeType.Bottom);
		stage74.setTotalTime(60);
		stage74.setLock(true);
		stage74.setItemCount(15);
		stage74.setItemStartIndex(9);
		stageInfos.add(stage74);

		// 75
		StageInfo stage75 = new StageInfo();
		stage75.setStageName("75");
		stage75.setArrType(GameArrangeType.Normal);
		stage75.setTotalTime(70);
		stage75.setLock(true);
		stage75.setItemCount(16);
		stage75.setItemStartIndex(15);
		stageInfos.add(stage75);

		// 76
		StageInfo stage76 = new StageInfo();
		stage76.setStageName("76");
		stage76.setArrType(GameArrangeType.Left);
		stage76.setTotalTime(70);
		stage76.setLock(true);
		stage76.setItemCount(16);
		stage76.setItemStartIndex(15);
		stageInfos.add(stage76);

		// 77
		StageInfo stage77 = new StageInfo();
		stage77.setStageName("77");
		stage77.setArrType(GameArrangeType.Right);
		stage77.setTotalTime(70);
		stage77.setLock(true);
		stage77.setItemCount(16);
		stage77.setItemStartIndex(15);
		stageInfos.add(stage77);

		// 78
		StageInfo stage78 = new StageInfo();
		stage78.setStageName("78");
		stage78.setArrType(GameArrangeType.Top);
		stage78.setTotalTime(60);
		stage78.setLock(true);
		stage78.setItemCount(16);
		stage78.setItemStartIndex(15);
		stageInfos.add(stage78);

		// 79
		StageInfo stage79 = new StageInfo();
		stage79.setStageName("79");
		stage79.setArrType(GameArrangeType.Bottom);
		stage79.setTotalTime(60);
		stage79.setLock(true);
		stage79.setItemCount(16);
		stage79.setItemStartIndex(15);
		stageInfos.add(stage79);

		// 80
		StageInfo stage80 = new StageInfo();
		stage80.setStageName("80");
		stage80.setArrType(GameArrangeType.LeftRight);
		stage80.setTotalTime(60);
		stage80.setLock(true);
		stage80.setItemCount(16);
		stage80.setItemStartIndex(15);
		stageInfos.add(stage80);

		// 81
		StageInfo stage81 = new StageInfo();
		stage81.setStageName("81");
		stage81.setArrType(GameArrangeType.TopBottom);
		stage81.setTotalTime(60);
		stage81.setLock(true);
		stage81.setItemCount(16);
		stage81.setItemStartIndex(15);
		stageInfos.add(stage81);

		// 82
		StageInfo stage82 = new StageInfo();
		stage82.setStageName("82");
		stage82.setArrType(GameArrangeType.Normal);
		stage82.setTotalTime(58);
		stage82.setLock(true);
		stage82.setItemCount(15);
		stage82.setItemStartIndex(24);
		stageInfos.add(stage82);

		// 83
		StageInfo stage83 = new StageInfo();
		stage83.setStageName("83");
		stage83.setArrType(GameArrangeType.LeftRight);
		stage83.setTotalTime(58);
		stage83.setLock(true);
		stage83.setItemCount(15);
		stage83.setItemStartIndex(24);
		stageInfos.add(stage83);

		// 84
		StageInfo stage84 = new StageInfo();
		stage84.setStageName("84");
		stage84.setArrType(GameArrangeType.TopBottom);
		stage84.setTotalTime(58);
		stage84.setLock(true);
		stage84.setItemCount(15);
		stage84.setItemStartIndex(24);
		stageInfos.add(stage84);

		// 85
		StageInfo stage85 = new StageInfo();
		stage85.setStageName("85");
		stage85.setArrType(GameArrangeType.Top);
		stage85.setTotalTime(58);
		stage85.setLock(true);
		stage85.setItemCount(15);
		stage85.setItemStartIndex(24);
		stageInfos.add(stage85);

		// 86
		StageInfo stage86 = new StageInfo();
		stage86.setStageName("86");
		stage86.setArrType(GameArrangeType.Left);
		stage86.setTotalTime(58);
		stage86.setLock(true);
		stage86.setItemCount(15);
		stage86.setItemStartIndex(24);
		stageInfos.add(stage86);

		// 87
		StageInfo stage87 = new StageInfo();
		stage87.setStageName("87");
		stage87.setArrType(GameArrangeType.Right);
		stage87.setTotalTime(58);
		stage87.setLock(true);
		stage87.setItemCount(15);
		stage87.setItemStartIndex(24);
		stageInfos.add(stage87);

		// 88
		StageInfo stage88 = new StageInfo();
		stage88.setStageName("88");
		stage88.setArrType(GameArrangeType.Bottom);
		stage88.setTotalTime(58);
		stage88.setLock(true);
		stage88.setItemCount(15);
		stage88.setItemStartIndex(24);
		stageInfos.add(stage88);

		// 89
		StageInfo stage89 = new StageInfo();
		stage89.setStageName("89");
		stage89.setArrType(GameArrangeType.Normal);
		stage89.setTotalTime(58);
		stage89.setLock(true);
		stage89.setItemCount(15);
		stage89.setItemStartIndex(0);
		stageInfos.add(stage89);

		// 90
		StageInfo stage90 = new StageInfo();
		stage90.setStageName("90");
		stage90.setArrType(GameArrangeType.Normal);
		stage90.setTotalTime(58);
		stage90.setLock(true);
		stage90.setItemCount(15);
		stage90.setItemStartIndex(20);
		stageInfos.add(stage90);

		// 91
		StageInfo stage91 = new StageInfo();
		stage91.setStageName("91");
		stage91.setArrType(GameArrangeType.TopBottom);
		stage91.setTotalTime(58);
		stage91.setLock(true);
		stage91.setItemCount(15);
		stage91.setItemStartIndex(0);
		stageInfos.add(stage91);

		// 92
		StageInfo stage92 = new StageInfo();
		stage92.setStageName("92");
		stage92.setArrType(GameArrangeType.LeftRight);
		stage92.setTotalTime(58);
		stage92.setLock(true);
		stage92.setItemCount(15);
		stage92.setItemStartIndex(20);
		stageInfos.add(stage92);

		// 93
		StageInfo stage93 = new StageInfo();
		stage93.setStageName("93");
		stage93.setArrType(GameArrangeType.Top);
		stage93.setTotalTime(58);
		stage93.setLock(true);
		stage93.setItemCount(15);
		stage93.setItemStartIndex(0);
		stageInfos.add(stage93);

		// 94
		StageInfo stage94 = new StageInfo();
		stage94.setStageName("94");
		stage94.setArrType(GameArrangeType.Left);
		stage94.setTotalTime(58);
		stage94.setLock(true);
		stage94.setItemCount(15);
		stage94.setItemStartIndex(20);
		stageInfos.add(stage94);

		// 95
		StageInfo stage95 = new StageInfo();
		stage95.setStageName("95");
		stage95.setArrType(GameArrangeType.Normal);
		stage95.setTotalTime(60);
		stage95.setLock(true);
		stage95.setItemCount(17);
		stage95.setItemStartIndex(0);
		stageInfos.add(stage95);

		// 96
		StageInfo stage96 = new StageInfo();
		stage96.setStageName("96");
		stage96.setArrType(GameArrangeType.Left);
		stage96.setTotalTime(60);
		stage96.setLock(true);
		stage96.setItemCount(17);
		stage96.setItemStartIndex(10);
		stageInfos.add(stage96);

		// 97
		StageInfo stage97 = new StageInfo();
		stage97.setStageName("97");
		stage97.setArrType(GameArrangeType.Right);
		stage97.setTotalTime(60);
		stage97.setLock(true);
		stage97.setItemCount(17);
		stage97.setItemStartIndex(0);
		stageInfos.add(stage97);

		// 98
		StageInfo stage98 = new StageInfo();
		stage98.setStageName("98");
		stage98.setArrType(GameArrangeType.Top);
		stage98.setTotalTime(60);
		stage98.setLock(true);
		stage98.setItemCount(17);
		stage98.setItemStartIndex(10);
		stageInfos.add(stage98);

		// 99
		StageInfo stage99 = new StageInfo();
		stage99.setStageName("99");
		stage99.setArrType(GameArrangeType.Bottom);
		stage99.setTotalTime(60);
		stage99.setLock(true);
		stage99.setItemCount(17);
		stage99.setItemStartIndex(0);
		stageInfos.add(stage99);

		// 100
		StageInfo stage100 = new StageInfo();
		stage100.setStageName("100");
		stage100.setArrType(GameArrangeType.TopBottom);
		stage100.setTotalTime(60);
		stage100.setLock(true);
		stage100.setItemCount(17);
		stage100.setItemStartIndex(10);
		stageInfos.add(stage100);
	}

	// 无用了
	private static final String STAGE_INFO_KEY = "stageInfos";

	// public void saveStageInfo() {
	// ShareSettingUtil.storeStringSetting(STAGE_INFO_KEY,
	// GsonHelper.getJsonString(stageInfos));
	// }

	// private void setDefaultStages() {
	// InputStream is = GameSystem.AndroidContext.getResources()
	// .openRawResource(R.raw.stages);
	// try {
	// byte[] buffer = null;
	// buffer = new byte[is.available()];
	// is.read(buffer);
	// String stages = new String(buffer);
	// stageInfos = (List<StageInfo>) GsonHelper.getObjectbyJsonString(
	// stages, new TypeToken<List<StageInfo>>() {
	// }.getType());
	// ShareSettingUtil.storeStringSetting(STAGE_INFO_KEY, stages);
	//
	// } catch (IOException e) {
	// e.printStackTrace();
	// }
	// try {
	// is.close();
	// } catch (IOException e) {
	// e.printStackTrace();
	// }
	// }

}
